import { Component, AfterViewInit } from '@angular/core';
import { LocalStorageService } from '../service/local-storage.service';

import * as $ from 'jquery';
@Component({
  selector: 'app-aside',
  templateUrl: 'aside.component.html'
})
export class AsideComponent implements AfterViewInit {
    userinfo: any;
    constructor( private localStorageService: LocalStorageService) {
        this.userinfo = this.localStorageService.readObject('userinfo');

    }
    // 视图层初始话完成
    ngAfterViewInit() {
        // 展开导航ul 列表 '.aside a + ul' 拿到.aside 的后代 a，紧跟在 a后面的ul标签
        $( '.aside a + ul').prev().click(function() {
            $(this).next().toggle();
        })

    }

}
